<?php
    include_once($_SERVER['DOCUMENT_ROOT']."/ExiaStore/Model/Articles/panier.php");
    include_once($_SERVER['DOCUMENT_ROOT']."/ExiaStore/Model/Articles/article.php");
    session_start();
    $panier = new panier();
    if(isset($_SESSION['panier'])){
        $article = new article($_GET['id']);        
        $articles = json_decode($_SESSION['panier'],true); 
        var_dump($articles);
        $panier->setArticle($articles);
        $panier->addArticle($article);
        $_SESSION['panier'] = json_encode($panier->getArticle());

    }else{
        $article = new article($_GET['id']);
        $panier->addArticle($article);
        $articles = $panier->getArticle();
        
        $_SESSION['panier'] = json_encode($articles);
              
    }
    
   
    include($_SERVER['DOCUMENT_ROOT']."ExiaStore/View/panier.php"); 
?>
